#ifndef _PROCESS_H_
#define _PROCESS_H_

#include "gtmonitor.h"
#include "common.h"

typedef struct processinfo_proto
{
	char name[PROCESS_NAME_LEN];
	char owner[OWNER_NAME_LEN];
	char status;
	unsigned int uid, pid, threadnum;
	int load;
	unsigned long rss;
	unsigned long delta_utime;
	unsigned long delta_stime;
	double delta_load;
	//void *next;
} process_info;

typedef process_info* process_info_ptr;

void sort(int keyword);

void ps_dump();

void ps_cleanup();

void init_process();

int is_ps_list_empty();

int get_ps_count();

int get_pid_by_index(int index);

int get_uid_by_index(int index);

unsigned long get_stime_by_index(int index);

unsigned long get_utime_by_index(int index);

int get_load_by_index(int index);

int get_rss_by_index(int index);

int get_threads_by_index(int index);

void get_name_by_index(int index, char *buf);

void get_owner_by_index(int index, char *buf);

void get_status_by_index(int index, char *c);

void get_name_by_uid(int uid, char *buf);

void refresh_process();

void ps_set_no_system_process(int noSystem);

int get_ps_self_load();

#endif /* _PROCESS_H_ */
